package dailytest;

import entity.PrescriptionDetail;
import org.apache.commons.lang.StringUtils;

import java.util.ArrayList;
import java.util.stream.Collectors;

/**
 * @Author: youdao.hww
 * @Date: 7/5/24
 * @Desc:
 */
public class CollecTest {



    public static void main(String[] args) {
        PrescriptionDetail one=new PrescriptionDetail();

        one.setTraceCode("1,2,3,4,5,6,7,8,9,10");

        PrescriptionDetail two=new PrescriptionDetail();

        two.setTraceCode("11,12,13,14,15");
        ArrayList<PrescriptionDetail> prescriptionDetails=new ArrayList<PrescriptionDetail>();
        prescriptionDetails.add(one);
        prescriptionDetails.add(two);

        String traceCodeStr = prescriptionDetails.stream().map(PrescriptionDetail::getTraceCode).filter(StringUtils::isNotBlank).collect(Collectors.joining(","));
        System.out.println("traceCodeStr = " + traceCodeStr);


        String cardNum="X431121199907191810";
        cardNum=cardNum.substring(1);

        System.out.println("cardNum = " + cardNum);


    }
}
